package com.wrb.points.custommapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * @author Wrb
 * @date 2019/12/31 16:30
 */
public interface PointsCustomMapper {

	@Update({
			"UPDATE points p SET available = p.available + #{amount} ",
			"WHERE p.points_id = #{pointsId} AND p.available + #{amount} >= 0"
	})
	int pointsChange(@Param(value = "pointsId") long pointsId, @Param(value = "amount") int amount);
}
